Robotics 1.0 Lesson Plan
Lesson 7 - Serve It Cool
2 classes (Duration: 1 hour 30 minutes; maximum 4 students per group).
Desktop or laptop computer, CPX board, USB cable
Micro Servo 9g
Adafruit Circuit Playground Express (CPX) board
USB cable
Computer with Mu Editor
Servo Control Using CPX Toggle Switch
Introduction to IR Sensor:
Using Try-Except block in CircuitPython
Handling Servo Motor Errors Using Try-Except in CircuitPython
Sample code:
Click here to view the instructions and code (without try-except)How to fix the error:
Click here to view the instructions and code (with try-except)Here is the solution:
servo.angle command.
View the code here
Is it better to prevent errors or handle them when they happen?